import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import HomePage from '../views/HomePage.vue'
import Login from '../views/Login.vue'
import Order from '../views/Order.vue'
import Star from '../views/Star.vue'
import Shopping from '../views/Shopping.vue'
import AllGoods from '../views/AllGoods.vue'
import Bags from '../views/Bags.vue'
import Pants from '../views/Pants.vue'
import Sweaters from '../views/Sweaters.vue'
import Dress from '../views/Dress.vue'
import Skirts from '../views/Skirts.vue'
import Shorts from '../views/Shorts.vue'
import TShirts from '../views/TShirts.vue'
import AllGoodsEdit from '../views/AllGoodsEdit.vue'
import StoreAdmin from "@/views/StoreAdmin";
import GoodsByStore from "@/views/GoodsByStore";
import GoodsByStoreEdit from "@/views/GoodsByStoreEdit";
import ModifyPassword from "@/views/ModifyPassword";
import StoreShowOrders from "@/views/StoreShowOrders";
import AllBuy from '../views/AllBuy.vue'
import EditInfo from '../views/EditInfo.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: "/homePage.html",
    children:[
      {path: "/homePage.html",name:'HomePage',component: HomePage},
      {path: "/order.html",name:'Order',component: Order},
      {path: "/star.html",name:'Star',component: Star},
      {path: "/shopping.html",name:'Shopping',component: Shopping},
      {path: "/bags.html",name:'Bags',component: Bags},
      {path: "/pants.html",name:'Pants',component: Pants},
      {path: "/sweaters.html",name:'Sweaters',component: Sweaters},
      {path: "/dress.html",name:'Dress',component: Dress},
      {path: "/skirts.html",name:'Skirts',component: Skirts},
      {path: "/shorts.html",name:'Shorts',component: Shorts},
      {path: "/tshirts.html",name:'TShirts',component: TShirts},
      {path: "/allBuy.html",name:'AllBuy',component: AllBuy},
      {path: "/editInfo.html",name:'EditInfo',component: EditInfo},
      {path: "/allBuy/editInfo/:id.html",name:'EditInfo',component: EditInfo},
      {path: "/goods/toEdit/:id.html",name:'AllGoodsEdit',component: AllGoodsEdit},
    ]
  },
  {
    path: '/login.html',
    name: 'Login',
    component: Login,
  },
  {path: "/allGoods.html",name:'AllGoods',component: AllGoods},
  {
    path: '/goodsbystore.html',
    name:'GoodsByStore',
    component: GoodsByStore,
  },
  {
    path: '/store/toEdit/:id.html',
    name:'GoodsByStoreEdit',
    component: GoodsByStoreEdit,
  },
  {
    path: '/store/toAdd.html',
    name:'GoodsByStoreEdit',
    component: GoodsByStoreEdit,
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path:'/storeAdmin.html',
    name:'StoreAdmin',
    component: StoreAdmin,
  },
  {
    path:'/modifyPassword.html',
    name:'ModifyPassword',
    component: ModifyPassword,
  },
  {
    path:'/storeShowOrders.html',
    name:'StoreShowOrders',
    component: StoreShowOrders,
  }
]

const router = new VueRouter({
  routes
})

export default router
